import Vue from 'vue'
import VueRouter from 'vue-router'


Vue.use(VueRouter)

const routes = [
  {path: '/', name: 'home',meta:{index:1}, component: () => import('../views/appHomePage/index.vue')},
  {path: '/product', name: 'product',meta:{index:2}, component: () => import('../views/pageProduct/index.vue')},
  {path: '/mine', name: 'mine', meta:{index:3},component: () => import('../views/pageMine/index.vue')},
  {path: '/shop', name: 'shop',meta:{index:4}, component: () => import('../views/pageShop/index.vue')},
  {path: '/category', name: 'category', meta:{index:5},component: () => import('../views/pageCategory/index.vue')},
  {path: '/faqs', name: 'faqs', meta:{index:6},component: () => import('../views/pageFAQS/index.vue')},
  {path: '/search', name: 'search', meta:{index:7},component: () => import('../views/pageSearch/index.vue')},
  {path: '/merchant', name: 'merchant', meta:{index:8},component: () => import('../views/pageMerchantSettlement/index.vue')},
  {path: '/loan', name: 'loan',meta:{index:9}, component: () => import('../views/pageLoan/index.vue')},
  {path: '/lang', name: 'lang',meta:{index:10}, component: () => import('../views/pageLanuage/index.vue')},
  {path: '/goods', name: 'goods', meta:{index:11},component: () => import('../views/pageGoods/index.vue')},
  {path: '/login', name: 'login', meta:{index:12},component: () => import('../views/pageLogin/index.vue')},
  {path: '/register', name: 'register',meta:{index:13}, component: () => import('../views/pageRegister/index.vue')},
  {path: '/setting', name: 'register',meta:{index:14}, component: () => import('../views/pageSetting/index.vue')},
  {path: '/resetPwd', name: 'resetPassword',meta:{index:15}, component: () => import('../views/pageReset/index.vue')},
  {path: '/fundPassword', name: 'resetPassword', meta:{index:16},component: () => import('../views/pageFundPassword/index.vue')},
  {path: '/address', name: 'address',meta:{index:17}, component: () => import('../views/pageAddress/index.vue')},
  {path: '/insertAddress', name: 'address', meta:{index:18},component: () => import('../views/pageInsertAddress/index.vue')},
  {path: '/order', name: 'order',meta:{index:19}, component: () => import('../views/pageOrder/index.vue')},
  {path: '/collect', name: 'collect',meta:{index:20}, component: () => import('../views/pageCollect/index.vue')},
  {path: '/collectShop', name: 'collectShop',meta:{index:21}, component: () => import('../views/pageCollectShop/index.vue')},
  {path: '/message', name: 'message', meta:{index:22},component: () => import('../views/pageMessage/index.vue')},
  {path: '/store', name: 'store', meta:{index:23}, component: () => import('../views/pageShopStore/index.vue')},
  {path: '/orderChecked', name: 'orderChecked',  meta:{index:24},component: () => import('../views/pageOrderChecked/index.vue')},
  {path: '/pay', name: 'pay', meta:{index:25}, component: () => import('../views/pagePay/index.vue')},
  {path: '/withdraw', name: 'withdraw', meta:{index:26}, component: () => import('../views/pageWithdraw/index.vue')},
  {path: '/withdrawRecode', name: 'withdrawRecode',  meta:{index:27},component: () => import('../views/pageWithdrawRecode/index.vue')},
  {path: '/recharge', name: 'recharge', meta:{index:28}, component: () => import('../views/pageRecharge/index.vue')},
  {path: '/rechargeRecode', name: 'rechargeRecode', meta:{index:29}, component: () => import('../views/pageRechargeRecode/index.vue')},
  {path: '/rechargeDetail', name: 'rechargeDetail', meta:{index:30}, component: () => import('../views/pageRechargeDetail/index.vue')},
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  scrollBehavior: () => ({ y: 0 }),//每次都跳转到顶部
  routes
})

export default router
